package com.example.vocab.controller;

import com.alibaba.fastjson.JSON;
import com.example.vocab.entity.History;
import com.example.vocab.service.HistoryService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

@RestController
public class HistoryController {

    @Resource(name="historyServiceImpl")
    HistoryService historyService;

    @RequestMapping("history")
    public List<History> getHistory(String username) {
        List<History> his = historyService.getHistory(username);
        return his;
    }

    @RequestMapping("chart")
    public List<History> getChart()
    {
        List<History> users = historyService.getChart();
        return users;
    }
}
